"use strict";
var FileGridItem = require("./file-grid-item");
function _interopDefaultLegacy(e) {
  return e && typeof e === "object" && "default" in e ? e : { "default": e };
}
var FileGridItem__default = /* @__PURE__ */ _interopDefaultLegacy(FileGridItem);
var render = function() {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c("div", { staticClass: "ele-file-list" }, [_vm.checkbox ? _c("div", { staticClass: "ele-file-list-header" }, [_c("div", { staticClass: "ele-file-list-check-group", on: { "click": function($event) {
    $event.stopPropagation();
    return _vm.checkAllChange.apply(null, arguments);
  } } }, [_c("i", { class: _vm.checkboxClass }), _vm.total ? _c("div", [_vm._v(" " + _vm._s(_vm.totalText && _vm.totalText.replace(/{total}/g, String(_vm.total))) + " ")]) : _c("div", [_vm._v(_vm._s(_vm.checkAllText))])])]) : _vm._e(), _vm._l(_vm.data, function(item, index) {
    return _c("FileGridItem", { key: index, attrs: { "item": item, "icons": _vm.icons, "checkbox": _vm.checkbox, "selection": _vm.selection }, on: { "item-click": _vm.itemClick, "item-check-change": _vm.itemCheckChange } });
  })], 2);
};
var staticRenderFns = [];
function normalizeComponent(scriptExports, render2, staticRenderFns2, functionalTemplate, injectStyles, scopeId, moduleIdentifier, shadowMode) {
  var options = typeof scriptExports === "function" ? scriptExports.options : scriptExports;
  if (render2) {
    options.render = render2;
    options.staticRenderFns = staticRenderFns2;
    options._compiled = true;
  }
  if (functionalTemplate) {
    options.functional = true;
  }
  if (scopeId) {
    options._scopeId = "data-v-" + scopeId;
  }
  var hook;
  if (moduleIdentifier) {
    hook = function(context) {
      context = context || this.$vnode && this.$vnode.ssrContext || this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext;
      if (!context && typeof __VUE_SSR_CONTEXT__ !== "undefined") {
        context = __VUE_SSR_CONTEXT__;
      }
      if (injectStyles) {
        injectStyles.call(this, context);
      }
      if (context && context._registeredComponents) {
        context._registeredComponents.add(moduleIdentifier);
      }
    };
    options._ssrRegister = hook;
  } else if (injectStyles) {
    hook = shadowMode ? function() {
      injectStyles.call(this, (options.functional ? this.parent : this).$root.$options.shadowRoot);
    } : injectStyles;
  }
  if (hook) {
    if (options.functional) {
      options._injectStyles = hook;
      var originalRender = options.render;
      options.render = function renderWithStyleInjection(h, context) {
        hook.call(context);
        return originalRender(h, context);
      };
    } else {
      var existing = options.beforeCreate;
      options.beforeCreate = existing ? [].concat(existing, hook) : [hook];
    }
  }
  return {
    exports: scriptExports,
    options
  };
}
const __vue2_script = {
  name: "FileGrid",
  components: { FileGridItem: FileGridItem__default["default"] },
  props: {
    data: {
      type: Array,
      required: true
    },
    icons: {
      type: Array,
      required: true
    },
    selection: Array,
    checkbox: Boolean,
    checked: Boolean,
    indeterminate: Boolean,
    total: Number,
    totalText: {
      type: String,
      required: true
    },
    checkAllText: String
  },
  emits: ["check-all-change", "item-click", "item-check-change"],
  computed: {
    checkboxClass() {
      return [
        "ele-file-list-check ele-file-icon-check ele-bg-primary",
        { checked: this.checked }
      ];
    }
  },
  methods: {
    checkAllChange() {
      this.$emit("check-all-change");
    },
    itemClick(item) {
      this.$emit("item-click", item);
    },
    itemCheckChange(item) {
      this.$emit("item-check-change", item);
    }
  }
};
const __cssModules = {};
var __component__ = /* @__PURE__ */ normalizeComponent(__vue2_script, render, staticRenderFns, false, __vue2_injectStyles, null, null, null);
function __vue2_injectStyles(context) {
  for (let o in __cssModules) {
    this[o] = __cssModules[o];
  }
}
var fileGrid = /* @__PURE__ */ function() {
  return __component__.exports;
}();
module.exports = fileGrid;
